package com.wanmait.wanmarecruit.manageController;

import com.wanmait.wanmarecruit.service.ApplyPositionService;
import com.wanmait.wanmarecruit.service.CompanyService;
import com.wanmait.wanmarecruit.service.RecruiterService;
import com.wanmait.wanmarecruit.service.UserService;
import com.wanmait.wanmarecruit.util.AjaxResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/manage")
public class ManageIndexController {
    @Resource
    private RecruiterService recruiterService;
    @Resource
    private UserService userService;
    @Resource
    private ApplyPositionService applyPositionService;
    @Resource
    private CompanyService companyService;

    @RequestMapping("getRecruiterCount")
    public AjaxResult getCount()
    {
        return AjaxResult.success(recruiterService.getRecruiterCount());
    }
    @RequestMapping("getUserCount")
    public AjaxResult getUserCount()
    {
        return AjaxResult.success(userService.count());
    }
    @RequestMapping("getCompanyCount")
    public AjaxResult getCompanyCount()
    {
        return AjaxResult.success(companyService.count());
    }
    @RequestMapping("getApplyPositionCount")
    public AjaxResult getApplyPositionCount()
    {
        return AjaxResult.success(applyPositionService.count());
    }
}
